home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / backup / kbackup-.000 / KBackup-1.2.7.tar / KBackup / src / read_data_src < prev    next >
Text File  |  1996-01-23  |  1KB  |  66 lines

  1. #
  2. # /home/kbackup/.CVSROOT/KBackup/src/read_data_src,v 1.8 1996/01/23 20:24:47 kbackup Exp
  3. #
  4. # This file is Copyright (C) 1995 by Karsten Ballⁿder
  5. #                Karsten.Ballueder@stud.uni-karlsruhe.de
  6. #
  7. # It is part of the KBackup package, see the file COPYING for details.
  8. #
  9. #
  10. #    function to reliably read data from tape, including double buffering
  11. #    and multi-volume handling
  12. #    - for Verify() and Restore()
  13. #
  14.  
  15. ReadData_src_loaded=YES
  16.  
  17.  
  18. read_data()
  19. {
  20.     if [ "$1" = "-raw" ]
  21.     then
  22.         shift
  23.         if [ "$1" != "" ]
  24.         then
  25.             rdfile="$1"
  26.         else
  27.             rdfile="$device"
  28.         fi
  29.         multibuf_cmd=`echo cat $rdfile`
  30.     else
  31.         if [ "$1" != "" ]
  32.         then
  33.             rdfile="$1"
  34.         else
  35.             rdfile="$device"
  36.         fi
  37.         if [ "$use_multibuf" = "YES" ]
  38.         then
  39.             set_multibuf_options READ
  40.             multibuf_cmd=`echo $MULTIBUF $multibuf_options -b $multibuf_blksize -n $multibuf_nblocks -r "$rdfile" `    
  41.         else
  42.             multibuf_cmd=`echo cat "$rdfile" `
  43.         fi
  44.     fi
  45.     
  46.  
  47.  
  48.     if [ "$remote_mode" = "YES" ]
  49.     then
  50.         if [ "$double_buffering" = "YES" ]
  51.         then
  52.             su $remote_uid -c "rsh $remote_host \"$multibuf_cmd | $DD  obs=$ddbufsize | cat \""
  53.         else
  54.             su $remote_uid -c "rsh $remote_host \"$multibuf_cmd | \""
  55.         fi
  56.     else
  57.         if [ "$double_buffering" = "YES" ]
  58.         then
  59.             `echo $multibuf_cmd` | $DD  obs=$ddbufsize 
  60.         else
  61.             `echo $multibuf_cmd`
  62.         fi
  63.     fi
  64.     
  65. }
  66.